//  todoList 的处理

const defaultState = {
    name: "张二丰",
    value: '我是默认值',
    list: [
        "好好学习",
        "天天向上"
    ],
    newsList: []
}

export default function todoList(prevState = defaultState, action) {
    switch (action.type) {
        case "changeValue":
            return {
                ...prevState,
                value:action.value
            }
            break;
      case "chageList":
            return {
                ...prevState,
                list:action.list
            }
            break;
          case "delList":
            return {
                ...prevState,
                newsList:action.list
            }
            break;
        
          case "changeNewsList":
            return {
                ...prevState,
                newsList:action.list
            }
            break;
        default:
            return prevState
            break;
    }
}